<template>
  <div>
    <h2>news Index page</h2>
    <div>newsID:{{$route.params.newsId}}</div>
    <ul>
      <li>
          <!-- 用a标签时herf为'/ '  看router中path为/时那么为index-->
        <nuxt-link :to="{name:'index'}">Home</nuxt-link>
      </li>
    </ul>
    <li>
        <!-- 动态路由 相当于news/id -->
      <nuxt-link :to='{name:"news-id",params:{id:123,title:"nuxt-practive"}}'>News123</nuxt-link>
    </li>
    <li>
        <!-- 参数校验 -->
      <a href="/news/xiaohui">News456</a>
      <!-- <a href="/news/456">News456</a> -->
    </li>
  </div>
</template>
<script>
export default {};
</script>
<style>
</style>